import { config } from '@vue/test-utils'
import { vi } from 'vitest'

// 全局配置Vue Test Utils
config.global.plugins = []

// 模拟Element Plus的ElMessage
vi.mock('element-plus', async () => {
  return {
    ElMessage: {
      success: vi.fn(),
      error: vi.fn(),
      warning: vi.fn(),
      info: vi.fn()
    }
  }
})

// 模拟navigator.clipboard
Object.defineProperty(navigator, 'clipboard', {
  value: {
    writeText: vi.fn(() => Promise.resolve())
  },
  writable: true
})

// 模拟document.execCommand
document.execCommand = vi.fn(() => true)
